<template>
<div>
  <div style="background: #44B6AE; width: 2050px;height:100px" >
    <h1 style="color: aliceblue;" >
      成裕生产管理系统
    </h1>
  </div>
  <el-form :inline="true" :model="user" class="demo-form-inline" >
    <el-form-item label="用户名">
      <el-input v-model="user.name" placeholder="用户名"></el-input>
    </el-form-item>
    <el-form-item label="密码">
      <el-input v-model="user.pwd" placeholder="密码"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="login" style="background: dimgrey">登录</el-button>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="login1" style="background: dimgrey">第三方登录</el-button>
    </el-form-item>
  </el-form>

</div>
</template>

<script>
export default {
  name: "IndexView",
  data() {
    return {
      user:{},


    }
  }, methods: {
    login1(){
      window.location='https://gitee.com/login';
    },
    login(){
      this.axios.get("user/login",{params:this.user}).then(res=>{
           if(res.data.code==1){
             this.$message.success("登录成功");
             sessionStorage.setItem("token",res.data.data.token);
             sessionStorage.setItem("nameee",res.data.data.name);
             sessionStorage.setItem("tnameee",res.data.data.tname);
             this.$router.push('stu')
           }else{
             this.$message.error(res.data.msg);
           }
      })
    }

  }, created() {

  }
}
</script>

<style scoped>

</style>